package com.winchain.chainbill.tbill.basic.rx;

import com.shell.framework.rx.OnErrorNotImplementedSubscriber;
import com.winchain.chainbill.tbill.basic.service.TBillOptService;
import com.winchain.chainbill.tbill.biz.TBill;
import com.winchain.chainbill.tbill.biz.TBillEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class TBillOptSubscriber extends OnErrorNotImplementedSubscriber<TBillEvent<? extends Object>> {
	@Autowired
	private TBillOptService tBillOptService;

	public void onApplicationEvent(TBillEvent<? extends Object> t) {
		this.tBillOptService.operate(t.getBill().getRec(), t.getOperation());
	}
}
